<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>商城管理系统</title>
<#include "common/header.ftl"/>
<link rel="stylesheet" href="/js/plugins/ztree/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="/js/plugins/jquery.twbsPagination.min.js"></script>
<script type="text/javascript" src="/js/plugins/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="/js/catalog.js"></script>
</head>
<body>
<div class="container">
<#include "common/top.ftl"/>
    <div class="row">
    <div class="col-sm-3">
    <#assign currentMenu="catalog" />
    <#include "common/menu.ftl" />
    </div>
    <div class="col-sm-9" style="width:20%;height:408px">
        <div class="page-header">
            <h3>分类管理</h3>
        </div>
        <form id="searchForm" class="form-inline" method="post" action="/addParent">
            <input type="hidden" name="id"/>
            <div class="form-group">
                <button id="add" type="button" class="btn btn-success">增加分类</button>
            </div>
            <div class="form-group">
                <button id="add_parent" type="button" class="fade">添加顶级分类</button>
            </div>
            <div class="content_wrap">
                <div class="zTreeDemoBackground left">
                    <ul id="catalogTree" class="ztree">
                    </ul>
                </div>
            <div class="right">
            </div>
        </form>
        <div class="col-sm-4">
        </div>
    </div>
</div>
    <#--显示详情面板-->
    <div id="catalogPanel" class="col-sm-8" style="width: 40%">
        <div class="panel panel-default" id="open" hidden="hide">
            <div class="panel-body">
                <form id="catalogEditForm" action="/catalog_update" method="post">
                    <input name="id" type="hidden">
                    <div class="modal-body">
                        <div class="form-group">
                            <label for="exampleInputEmail1">分类编号</label>
                            <input class="form-control" name="code">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">分类名</label>
                            <input class="form-control" name="name">
                        </div>
                        <div class="modal-footer">
                            <button class="btn btn-default" onclick="del();" type="button" data-dismiss="modal">删除</button>
                            <button id="eidtButton" class="btn btn-primary" type="button">保存</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
<#--添加分类面板-->
<div class="modal fade" id="catalogModal" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content" style="width:60%;margin-left:20%">
            <div class="modal-body" style="margin-left: 100px">
                <form class="form-horizontal" id="editform" method="post" action="/catalog_save">
                    <fieldset style="width: 80%">
                        <div id="legend" class="">
                            <legend>分类管理</legend>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">上级分类</label>
                            <input id="parentCatalogId" name="parentCatalogId" type="hidden">
                            <input id="parentCatalog" class="form-control" readonly="readonly">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">分类编号</label>
                            <input id="code" class="form-control" name="code">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">分类名</label>
                            <input id="name" class="form-control" name="name">
                        </div>
                    </fieldset>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-success btn_audit" id="save">保存</button>
                <button type="button" class="btn btn-warning btn_audit" id="cancel">取消</button>
            </div>
        </div>
    </div>
</div>
</body>
</html>